package com.prime.tutorial.moviestore.view.reports;

import com.prime.tutorial.moviestore.domain.Device;
import com.prime.tutorial.moviestore.service.reports.ReportsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.util.List;
/**
 * Provides the view level of the cpesInstalled report.
 * @author vasylja
 */
@Component("cpesInstalled")
@Scope("request")
public class CPEsInstalledImpl {
    private ReportsService reportsService;
    private List<Device> listDevices;

    @Autowired
    public CPEsInstalledImpl(ReportsService reportsService) {
        this.reportsService = reportsService;
        setListDevices(this.reportsService.getCPEsInstalledReport());
    }


    public List<Device> getListDevices() {
        return listDevices;
    }

    private void setListDevices(List<Device> listDevices) {
        this.listDevices = listDevices;
    }
}
